// 遍历所有的类
ObjC.enumerateClasses({
  onMatch: function (klass) {
      try {
          // 获取类名
          var className = ObjC.classes[klass].$className;
          // 获取类的所有方法
          var methods = ObjC.classes[klass].$ownMethods;
          methods.forEach(function (methodName) {
              // 获取方法签名
              var method = new ObjC.Method(ObjC.classes[klass], methodName);
              var methodSignature = method.signature;
              var parameterTypes = [];
              // 解析参数类型
              for (var i = 2; i < methodSignature.length; i++) {
                  var paramType = methodSignature[i];
                  parameterTypes.push(paramType);
              }
              console.log("Class: " + className);
              console.log("Method: " + methodName);
              console.log("Parameters: " + parameterTypes.join(", "));
          });
      } catch (e) {
          console.error("Error processing class " + klass + ": " + e);
      }
  },
  onComplete: function () {}
});
// 遍历所有的类
ObjC.enumerateClasses({
  onMatch: function (klass) {
      try {
          // 尝试获取类的完整名称
          var className = ObjC.classes[klass].$className;
          // 过滤出 Swift 类（Swift 类名通常包含`__`）
          if (className && className.includes("__")) {
              // 获取类的所有方法
              var methods = ObjC.classes[klass].$ownMethods;
              methods.forEach(function (methodName) {
                  // 获取方法签名
                  var method = new ObjC.Method(ObjC.classes[klass], methodName);
                  var methodSignature = method.signature;
                  var parameterTypes = [];
                  // 解析参数类型
                  for (var i = 2; i < methodSignature.length; i++) {
                      var paramType = methodSignature[i];
                      parameterTypes.push(paramType);
                  }
                  console.log("Class: " + className);
                  console.log("Method: " + methodName);
                  console.log("Parameters: " + parameterTypes.join(", "));
              });
          }
      } catch (e) {
          console.error("Error processing class " + klass + ": " + e);
      }
  },
  onComplete: function () {}
});
